﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using appLibrary;

namespace appSysSalesV._1.Forms
{
    public partial class FrmArticles : Form
    {
        public string user { set; get; }
        public int idUser { set; get; }
        public int idRole { set; get; }
        public FrmArticles()
        {
            InitializeComponent();
        }

        private void btnArticles_Click(object sender, EventArgs e)
        {
            string strCod = "", strDesc = "";
            ViewQueries viewQueries = new ViewQueries();

            string[] strFields = { "id_article as codigo ", "description as descripcion" };


            viewQueries.getData(strFields, "sales.ma_articles", "id_article", "description",
                null, null, user, ref strCod, ref strDesc);
            if (strCod != null)
            {
                txtCodArticles.Text = strCod;
                txtDescArticles.Text = strDesc;
            }
        }


        private void formatDgvArticles(ref DataGridView dgvArticles )
        {
            dgvArticles.Columns[0].HeaderText = "Código";
            dgvArticles.Columns[1].HeaderText = "Descripción";
            dgvArticles.Columns[2].Visible = false;
            dgvArticles.Columns[3].HeaderText = "Nivel";
            dgvArticles.Columns[4].Visible = false;
            dgvArticles.Columns[5].HeaderText = "Sector";
            dgvArticles.Columns[6].Visible = false;
            dgvArticles.Columns[7].HeaderText = "Tipo Labor";
            

        }
    }
}
